import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hsh/brick/brick.dart';
import 'package:flutter_hsh/style/style.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../fluttergromore/config/app_const.dart';
import 'splash_logic.dart';

class SplashPage extends GetView<VCSplashLogic> {

  const SplashPage({super.key});


  @override
  Widget build(BuildContext context) {
    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: SystemUiOverlayStyle.light,
      child: Container(
        width: double.infinity,
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage(AppConst.appStartBg),
            fit: BoxFit.fill,
          ),
        ),
        child: Stack(
          children: [
            Center(
              child: Column(
                children: [
                  // ClipRRect(
                  //   borderRadius: BorderRadius.circular(10.w),
                  //   child: Image.asset(AppConst.appLogo, width: 128.w),
                  // ).paddingOnly(top: 105.h, bottom: 22),
                  // Text(
                  //   AppConst.appName,
                  //   style: TextStyle(
                  //       fontSize: 20.w,
                  //       fontWeight: FontWeight.bold,
                  //       color: Colors.black),
                  // ),
                  const Spacer(),
                  UIText(
                      text: '正在加载中...',
                      textColor: kAppColor('#333333'),
                      fontSize: 14.sp),
                  UIContainer(
                    margin: EdgeInsets.only(top: 16.w, bottom: 70.h),
                    width: 270.w,
                    height: 6.h,
                    child: ClipRRect(
                      borderRadius: BorderRadius.circular(22.w),
                      child: LinearProgressIndicator(
                          backgroundColor: kAppColor('#FFFFFF'),
                          color: kAppColor('#555555')),
                    ),
                  ),
                ],
              ),
            ),
            Positioned(
              right: 16,
              top: 30,
              child: Obx(() {
                return UIText(
                  text: controller.riseId.value,
                  fontSize: 16.sp,
                  textColor: Colors.white,
                  fontWeight: FontWeight.bold,
                  margin: const EdgeInsets.only(top: 12),
                );
              }),
            ),
          ],
        ),
      ),
    );
  }
}
